<?php

use App\Admin\Controllers\ReceiptController;
use App\Admin\Controllers\UsersLeaveMsgController;
use Dcat\Admin\Admin;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    // $router->get('auth/login', 'AuthController@getLogin');自定义登录
    // $router->post('auth/login', 'AuthController@postLogin'); 自定义登录



    $router->get('/', 'HomeController@index');
    $router->resource('user/list', 'UserController'); //用户列表

    $router->resource('/todo/list', 'TodoProcessedController')
        ->names('todo.list');; //待办事项 待处理
    $router->resource('/processed/list', 'ProcessedController')
        ->names('processed.list'); // 待办事项 已处理


    // 订单
    $router->resource('order/list', 'OrderController')->names('order.list'); // 订单列表

    $router->resource('order/my', 'MyOrderController')->names('order.my');

    $router->get('/getOrderDiscipline', 'OrderController@getOrderDiscipline'); //订单

    $router->get('/getMyOrderDiscipline', 'MyOrderController@getOrderDiscipline'); //我的订单

    // 文章管理
    $router->resource('article/list', 'ArticleController');
    // 视频管理
    $router->resource('video/list', 'VideoController');
    // 分类管理
    $router->resource('category/list', 'CategoryController');






    #############################       以下是weidingyi定义的路由     ################################

    $router->any('users/files', 'FileController@handle'); // 文件上传

    $router->resource('leaveMsg', UsersLeaveMsgController::class); // 留言管理

    $router->resource('journal', 'JournalController'); //期刊列表

    $router->resource('receipt', ReceiptController::class); // 发票记录管理
    $router->resource('receiptInfo/list', ReceiptInfoController::class); // 发票信息管理

    $router->resource('comment', \App\Admin\Controllers\OrderCommentController::class); // 评价管理

    $router->post('receipt/set_status/{id}', [ReceiptController::class, 'set_status'])->whereAlphaNumeric('id');

    $router->post('/journal/handleImport', [\App\Admin\Controllers\JournalController::class, 'handleImport']); // 导入期刊

    $router->resource('ads', \App\Admin\Controllers\AdController::class); // 广告管理

});
